#!/bin/bash
read -p "请输入你的ip地址："  ip_adr
read -p "请输入你的用户名："  Source_Username
read -p "请输入你的ip地址："  Source_Password
# 定义数据源数组
declare -A my_array=(
        [customer_risk_overview]="ads_alert_rule_performance"
        [transaction_risk_report]="ads_customer_risk_overview"
        [compliance_monthly_report]="ads_customer_risk_overview"
        [alert_rule_performance]="ads_transaction_risk_report")

# 遍历关联数组的表名
for table_name in "${!my_array[@]}"
do
    # 通过键获取表所在位置
    hive_path="${my_array[$table_name]}"
	sqoop export \
	--connect jdbc:oracle:thin:@"$ora_ip":1521/orcl \
    --username "$Source_Username" \		
    --password "$Source_Password" \		
    --table "$tab" \
    --export-dir "/user/hive/warehouse/ads.db/$hive_path"
    --input-fields-terminated-by ',' \			
	-m 1								
done